class Solution(object):
    def removeElement(self, nums, val):
        """
        :type nums: List[int]
        :type val: int
        :rtype: int
        """
        i = 0
        while i < len(nums):
            if nums[i] == val:
                nums.pop(i)
                continue
            i += 1

        return len(nums)

s = Solution()
nums = []
r = s.removeElement(nums, 3)
print(r)
print(nums)

